const mongoose = require('mongoose');
const foodSchema = new mongoose.Schema({
  name: { type: String, require: true },
  price: { type: String, require: true },
  desc: { type: String, require:true },
  typename: { type: String, require:true },
  typeid: { type: String, require:true },
  img: { type: String, require:true },
});
// 将schema对象转换为数据模型
const Food = mongoose.model('foods', foodSchema); // 该数据对象和集合关联('集合名',schema对象)

module.exports = Food;